<?php
class Zend_View_Helper_TopMenu extends Zend_View_Helper_Abstract{

	protected $auth_instance;
	
	public function topMenu (){
		
		$this->auth_instance = Zend_Auth::getInstance();
		$session_obj = $this->auth_instance->getStorage()->read();
		$return = "<a href='/'>Acasa</a> &nbsp;&nbsp;&nbsp;";
		
		if ($session_obj != null){
			$user = new Application_Model_User(get_object_vars($session_obj));
			
			if ($user->getIs_admin() == 1){
				$return.= "<a href='/admin/products'>Produse</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/admin/categories'>Categorii de Produse</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/admin/offers'>Oferte</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/admin/orders'>Comenzi</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/admin/media'>Galerie Media</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/admin/users'>Utilizatori</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/myAccount'>Contul meu</a>";
			} else {
				$return.= "<a href='/cart'>Cosul meu</a> &nbsp;&nbsp;&nbsp;";
				$return.= "<a href='/myAccount'>Contul meu</a>";
			}
		} else {
			$return.= "<a href='/cart'>Cosul meu</a> &nbsp;&nbsp;&nbsp;";
			$return.= "<a href='/myAccount'>Contul meu</a>";
		}
		return $return;
	}
}